﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace tiDE.Settings
{
    public class SettingGroupAttribute : Attribute
    {
        public string SettingGroup;

        public SettingGroupAttribute(string SettingGroup)
        {
            this.SettingGroup = SettingGroup;
        }
    }

    public class SettingSubgroupAttribute : Attribute
    {
        public string SettingSubgroup;

        public SettingSubgroupAttribute(string SettingSubgroup)
        {
            this.SettingSubgroup = SettingSubgroup;
        }
    }

    public class SettingEditorAttribute : Attribute
    {
        public SpecialEditorType EditorType;

        public SettingEditorAttribute(SpecialEditorType EditorType)
        {
            this.EditorType = EditorType;
        }
    }

    public class SettingOptionSetAttribute : Attribute
    {
        public string[] Options;

        public SettingOptionSetAttribute(params string[] Options)
        {
            this.Options = Options;
        }
    }

    public class SettingDescriptionAttribute : Attribute
    {
        public string Description;

        public SettingDescriptionAttribute(string Description)
        {
            this.Description = Description;
        }
    }

    public class SettingValidatorAttribute : Attribute
    {
        public string Validator;

        /// <summary>
        /// Creates a new validator attribute
        /// </summary>
        /// <param name="Validator">The name of a public, static method in the parent class with the return type SettingValidatorResponse whose parameters are object, object.</param>
        /// <see cref="http://http://tidenv.codeplex.com/wikipage?title=Custom%20Settings"/>
        public SettingValidatorAttribute(string Validator)
        {
            this.Validator = Validator;
        }
    }

    public class SettingNameAttribute : Attribute
    {
        public string Name;

        public SettingNameAttribute(string Name)
        {
            this.Name = Name;
        }
    }

    public class SettingHideFromViewAttribute : Attribute
    {
    }

    public class SettingFileBrowserFilter : Attribute
    {
        public string Filter;

        public SettingFileBrowserFilter(string Filter)
        {
            this.Filter = Filter;
        }
    }

    public class SettingValidatorResponse
    {
        public bool IsValid;
        public string ValidationMessage;

        public SettingValidatorResponse()
        {

        }

        public SettingValidatorResponse(bool IsValid, string ValidationMessage)
        {
            this.IsValid = IsValid;
            this.ValidationMessage = ValidationMessage;
        }
    }

    public enum SpecialEditorType
    {
        OptionSet,
        FileBrowse,
        MultilineText,
    }
}
